package com.myapp.struts.menu;

import java.util.ArrayList;

public class USDinnerHTML {

    private static USDinnerHTML usDinnerHTMLObj;
    ArrayList<FoodItems> usdinnerHTMLArray = new ArrayList<FoodItems>();

    public static synchronized USDinnerHTML getSingletonObject() {
        if (usDinnerHTMLObj == null) {
            usDinnerHTMLObj = new USDinnerHTML();
        }
        return usDinnerHTMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getUSDinnerHTML(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        usdinnerHTMLArray = menuReadObj.ReadMenu(Constants.US);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        usdinnerHTMLArray = menuGenerateObj.GenerateMenu(usdinnerHTMLArray, Constants.DINNER);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(usdinnerHTMLArray, Constants.HTML, fileLoc);
        return fileName;
    }
}
